This example is incomplete!
https://github.com/jasondavies/conrec.js
https://github.com/d3/d3-contour
Additional functionality...
Implementation note
The background represents two different things depending on the feature of interest. If the original feature is boolean (e.g. dengue diagnosis) the z value is related with the number of positive values in the bin. This can be done in two different ways: (i) estimating the density distribution using a gaussian kernel in which only 'true' values found on the bin are considered or (ii) compute the ratio of 'true' to 'positive' samples. Note in the latter the 'false' values are also considered. If the original feature is numeric, the mean of all the values within the bin is computed. Finally, if the feature is enumerated the background might or might not be displayed but these categories can be displayed using the colors in the scatter plot.